 .EJ
;
; SCHAAKPROGRAMMA USURPATOR II
;
;
 .BA $200
 .MC $A200
 .CT
 .CE
;
;
;PARAMETERS EN EXTERNE ROUTINES
;
SCHAAK .DE $3900
MAT .DE 0-$2800
FMAT .DE 0-$2300
OSTK .DE $107
SAVS .DE $106
SAVT .DE $105
BUDGET .DE 10
INALL .DE $E993 ;INPUT 1 CHAR (IN ACC)
OUTALL .DE $E97A ;PRINT 1 CHAR (UIT ACC)
CRLF .DE $EA13 ;PRINT CR+LF
MONIT .DE $E1A1 ;TERUG NAAR MONITOR
BLANK .DE $E83E ;PRINT 1 SPATIE
NUMA .DE $EA46 ;PRINT ACCU ALS TWEE HEX DIGITS
WRAX .DE $EA42 ;PRINT A (MSB) EN X ALS 4 HEX
VIA .DE $A000
T1CL .DE VIA+4
ACR .DE VIA+11
IFR .DE VIA+13
IER .DE VIA+14
PRIFLG .DE $A411 ;PRINTER FLAG
TPZ .DE 120 ;TIJD (SEC) PER ZET
MSCHK .DE 0-SCHAAK
TIME .DE 50000-2
;
;
;
;VARIABELEN
;
BORD .DE 0
MARK .DE BORD+64
ETYD .DE MARK+64
MTYD .DE ETYD+2
KLEUR .DE MTYD+6
ZETTEN .DE KLEUR+1
DEPTH .DE ZETTEN+1
COST .DE DEPTH+1
MAXDEP .DE COST+1
MAXCOS .DE MAXDEP+1
STUK .DE MAXCOS+1
TOSTUK .DE STUK+1
MODE .DE TOSTUK+1
KCNT .DE MODE+1
TOX .DE KCNT+1
TOY .DE TOX+1
PROCES .DE TOY+1
ZET .DE PROCES+2
MAXVAL .DE ZET+3
STAVAL .DE MAXVAL+2
DYNVAL .DE STAVAL+2
LIMIT .DE DYNVAL+2
IPTR .DE LIMIT+2
SV .DE IPTR+1
OLDSV .DE SV+1
JPTR .DE OLDSV+1
RPTR .DE JPTR+1
BPTR .DE RPTR+1
TV .DE BPTR+1
OLDTV .DE TV+1
CLASS .DE OLDTV+1
WPTR .DE CLASS+1
PPTR .DE WPTR+1
XCNT .DE PPTR+1
YCNT .DE XCNT+1
XSAV .DE YCNT+1
SUM .DE XSAV+2
RANDOM .DE SUM+2
PASFLG .DE RANDOM+1
MOB .DE PASFLG+1
EINDSP .DE MOB+1
LAST .DE EINDSP+1
SPTR .DE LAST+1
TMP .DE SPTR+1
EXTRA .DE TMP+1
MVELD .DE EXTRA+1
ALARM .DE MVELD+1
AGRES .DE ALARM+1
LINE .DE AGRES+1
OMODE .DE LINE+1
NR .DE OMODE+1
PRISAV .DE NR+1
MOVDIR .DE PRISAV+1
KPOS .DE MOVDIR+1
KFLG .DE KPOS+1
TICKS .DE KFLG+1
TNOD .DE TICKS+1
DFLG .DE TNOD+1
MOB2 .DE DFLG+1
VFLG .DE MOB2+1
BONUS .DE VFLG+1
OKFLG .DE BONUS+1
PFLG .DE OKFLG+1
KP1 .DE PFLG+1
KP2 .DE KP1+1
CODE .DE KP2+1
SFLG .DE CODE+1
SST .DE SFLG+1
DREIG .DE SST+1
S2FLG .DE DREIG+1
BDT .DE S2FLG+1
DEKCNT .DE BDT+2
DEKFLG .DE DEKCNT+2
SDIF .DE DEKFLG+1
PANIK .DE SDIF+1
MFLG .DE PANIK+1
EZERO .DE MFLG+1
;
;
;
;HOOFDPROGRAMMA
;
 JSR INIT
MAIN LDX #$FF
 TXS
LOOP JSR WTYD
 LDA *SV
 STA *OLDSV
 LDA *TV
 STA *OLDTV
 LDA *IPTR
 ORA #$80 ;WEG BIJ SNELSCHAAK
 STA *SV
 LDA *BPTR
 ORA #$80 ;WEG BIJ SNELSCHAAK
 STA *TV
 LDX *MOB
 LDA *MOB2
 STA *MOB
 STX *MOB2
 INC *NR
ERLP JSR INLEES
 LDX T1CL ;HAAL RANDOM WAARDE UIT
 STX *RANDOM ;LOWER BYTE TIMER
 JSR MTMOB
 JSR KTEL
 LDA *ZET
 BMI M1A
 JMP M1
;
;
;
M1A JSR WIS
 JSR EVAL
 LDA *SDIF
 ASL A
 CLC
 ADC *SUM+1
 ASL A
 ASL A
 ASL A
 STA *BONUS
 LDA #0
 STA *EINDSP
 STA *TNOD
SPEED LDA #L,BUDGET
 LDX *MOB
 CPX #26
 BCS M5
 INC *EINDSP
 LDY *DFLG
 BNE M5C
 TAY
 INY
 TXA
 CLC
 ADC *MOB2
 CMP #50
 TYA
 BCS M5C
 CLC
 ADC #2
M5C LDY *PFLG
 BEQ M5B
 LDY *KFLG
 BNE M5
M5B CPX #11
 BCC M5A
 LDX *MOB2
 CPX #11
 BCS M5
M5A ADC #2
M5 STA *MAXCOS
 SEI
 LDA *MTYD
 CMP *ETYD
 LDA *MTYD+1
 SBC *ETYD+1
 CLI
 BCS NTN
 LDA #$80
 STA *TNOD
 LDA *MAXCOS
 SEC
 SBC #3
 STA *MAXCOS
NTN LDX #L,DENK
 STX *PROCES
 LDX #H,DENK
 STX *PROCES+1
 LDA PRIFLG ;SAVE PRINTER TOESTAND
 STA *PRISAV
 LDA #0
 STA PRIFLG ;ZET PRINTER UIT BIJ DENKEN
 JSR CRLF ;NIEUWE REGEL
 JSR LDG
 JSR STATUS ;PRINT STATUS INFO
 LDA *PRISAV ;HERSTEL PRINTER TOESTAND
 STA PRIFLG
 LDX *DYNVAL
 LDY *DYNVAL+1
 LDA *ZETTEN
 BNE X0
 JMP EINDE
X0 CPX #L,SCHAAK
 BNE X1
 CPY #H,SCHAAK
 BNE X1
 JMP WIN
X1 LDA *ZET
 STA *IPTR
 LDA *ZET+1
 STA *BPTR
 STA *LAST
 LDA *ZET+2
 STA *MODE
 STA *OMODE
 JSR DOEZET
 JSR CRLF ;NIEUWE REGEL
 LDA *NR
 LSR A
 JSR NUMA ;PRINT NUMMER VAN DE ZET
 JSR BLANK ;SPATIE
 JSR PZET
 JSR BLANK ;SPATIE
BACK JMP LOOP
;
;
;
INLEES JSR INALL ;LEES 1e CHAR VAN INPUT
 CMP #$D
 BNE ILS1
 LDA #$FF
 STA *ZET
 RTS
ILS1 JMP LZET
;
;
;
M1 LDA #L,ZTST
 STA *PROCES
 LDA #H,ZTST
 STA *PROCES+1
 LDA #0
 STA *OKFLG
 STA *EXTRA
 JSR SCAN2
 LDA *OKFLG
 BNE REG
 JMP ERR
REG LDA *ZET
 STA *IPTR
 LDA *ZET+1
 STA *BPTR
 LDA *ZET+2
 STA *MODE
 STA *OMODE
 JSR CRLF ;NIEUWE REGEL
 JSR DOEZET
 LDA *BPTR
 STA *LAST
 JMP LOOP
;
;
;
EINDE CPX #L,FMAT
 BNE M2
 CPY #H,FMAT
 BNE M2
 LDX #MES4-MES1
 BNE M3
M2 LDX #MES5-MES1
M3 JSR PRT
 JMP MONIT ;NAAR MONITOR
WIN LDX #MES6-MES1
 BNE M3
;
;
;
LZET JSR CK1
 STA *ZET
 JSR CHECK
 STA *ZET+1
 RTS
CHECK JSR INALL ;LEES LETTER VAN VELD
CK1 SEC
 SBC #'A
 BCC ERR
 CMP #8
 BCS ERR
 STA *TMP
 JSR INALL ;LEES CIJFER VAN VELD
 SEC
 SBC #'1
 BCC ERR
 CMP #8
 BCS ERR
 EOR #7
 ASL A
 ASL A
 ASL A
 ORA *TMP
 RTS
ERR LDX #MES3-MES1
 JSR PRT
 LDX #$FF
 TXS
 JMP ERLP
;
;
;
PZET LDA *ZET
 JSR PVELD
 LDA *ZET+1
PVELD PHA
 AND #7
 CLC
 ADC #'A
 JSR OUTALL ;PRINT LETTER VAN VELD
 PLA
 LSR A
 LSR A
 LSR A
 EOR #7
 CLC
 ADC #'1
 JMP OUTALL
;
;
;
SCAN0 LDA *DEKFLG
 BEQ LDG
 LDX #L,COMP
 STX *PROCES
 LDX #H,COMP
 STX *PROCES+1
 LDY *ALARM
 LDA #0
 STA (DEKCNT),Y
 STA *DEKFLG
 LDX *BPTR
 INX
 TXA
 DEX
 AND #$3F
 STA *MVELD
 JSR WISSEL
 JSR NVELD
 JSR WISSEL
 LDX #L,DENK
 STX *PROCES
 LDX #H,DENK
 STX *PROCES+1
 LDY *ALARM
 LDA (DEKCNT),Y
 BNE LDG
 DEC *DEKFLG
 RTS
;
;
;
LDG LDA *DREIG
 STA *SST
 LDA *COST
 CLC
 ADC #3
 CMP *MAXCOS
 BCC VLG
 LDA *EXTRA
 CMP #H,MSCHK
 BEQ VLG
 LDA *PASFLG
 BMI SCAN1
VLG LDA #L,STE1
 STA *PROCES
 LDA #H,STE1
 STA *PROCES+1
 LDY #63
DKLP LDA #0
 STA (DEKCNT),Y
 LDA BORD,Y
 AND #$BF
 STA BORD,Y
 DEY
 BPL DKLP
 JSR SCAN
 LDA #L,DENK
 STA *PROCES
 LDA #H,DENK
 STA *PROCES+1
 LDX *MAXVAL+1
 CPX #H,SCHAAK
 BNE SCAN1
 JMP CUTOFF
;
;
;
SCAN1 LDX #0
 STX *EXTRA
 STX *MFLG
 DEX
 STX *ALARM
 LDA *SFLG
 BEQ SZ
 LDX *PASFLG
 INX
 BMI SCAN
 BPL SZET
SZ LDA *PASFLG
 BMI SCAN
SZET LDA *STUK
 AND #7
 CMP #6
 BEQ MD0
 CMP #3
 BCC MD0
 LDX *JPTR
 LDA GRP,X
 LDX *TOSTUK
 BEQ MD1
MD0 LDA #5
MD1 STA *MOVDIR
 LDX #L,KIJK
 STX *PROCES
 LDX #H,KIJK
 STX *PROCES+1
 JSR WISSEL
 LDX *TV
 INX
 TXA
 AND #$3F
 STA *MVELD
 JSR SCAN2
 JSR WISSEL
 LDX #L,DENK
 STX *PROCES
 LDX #H,DENK
 STX *PROCES+1
 LDA *MFLG
 BEQ PFP1
 LDA #0
 LDX *EXTRA
 CPX #H,SCHAAK
 BEQ PFP1
 LDA #$F0
PFP1 SEC
 SBC *EXTRA
 STA *EXTRA
SCAN LDX #L,MSCHK
 STX *MAXVAL
 LDX #H,MSCHK
 STX *MAXVAL+1
 LDX *SST
 STX *MVELD
SCAN3 LDX #0
 STX *ZETTEN
;
;
;
SCAN2 LDX *MVELD
NVELD LDA *BORD,X
 BEQ NOSTUK
 STA *STUK
 AND #8
 CMP *KLEUR
 BNE NOSTUK
 JMP MIJNST
NOSTUK INX
 TXA
 AND #$3F
 TAX
 CPX *MVELD
 BNE NVELD
 LDA *ZETTEN
 BNE CUTOFF
 INC *ZETTEN
 LDX #L,STEST
 STX *PROCES
 LDX #H,STEST
 STX *PROCES+1
 JSR WISSEL
 JSR SCAN2
 JSR WISSEL
 LDX #L,DENK
 STX *PROCES
 LDX #H,DENK
 STX *PROCES+1
 LDX #0
 STX *ZETTEN
 LDX *DYNVAL
 LDY *DYNVAL+1
 CPX #L,SCHAAK
 BNE PAT
 CPY #H,SCHAAK
 BNE PAT
 LDX #L,MAT
 LDY #H,MAT
 JMP RET
PAT JSR EVAL
 JMP RET
;
;
;
CUTOFF LDX *MAXVAL
 LDY *MAXVAL+1
RET STX *DYNVAL
 STY *DYNVAL+1
 BIT *DYNVAL+1
 BPL STS2
 TYA
 LSR A
 ROR *DYNVAL
 LSR A
 ROR *DYNVAL
 LSR A
 ROR *DYNVAL
 ORA #$E0
 TAY
 TXA
 SEC
 SBC *DYNVAL
 STA *DYNVAL
 LDA *DYNVAL+1
 STY *DYNVAL+1
 SBC *DYNVAL+1
 STA *DYNVAL+1
STS2 RTS
;
;
;
STE1 INC *ZETTEN
 LDA *TV
 AND #$3F
 CMP *BPTR
 BNE STEST
 LDA *IPTR
 STA *SST
STEST LDA *TOSTUK
 AND #7
 CMP #6
 BNE STS1
 JMP BAD
STS1 RTS
;
;
;
MES1 .BY $0D $0A 0
MES3 .BY '?' 0
MES4 .BY ' IK STA MAT' 0
MES5 .BY ' IK STA PAT' 0
MES6 .BY ' IK WIN!' 0
;
;
;
MIJNST LDA *STUK
 AND #7
 ASL A
 ASL A
 ASL A
 ASL A
 CLC
 ADC #$0F
 STA *RPTR
 LDA #$0F
 STA *JPTR
 STX *IPTR
NDIR LDX *RPTR
 LDA RANGE,X
 BEQ BREAK
 BPL VALDIR
 EOR #$FF
 STA *RPTR
 AND #$0F
 STA *JPTR
BREAK DEC *RPTR
 DEC *JPTR
 BPL NDIR
 LDX *IPTR
 JMP NOSTUK
;
;
;
VALDIR STA *MODE
 AND #$0F
 STA *KCNT
 LDA *VFLG
 CMP *DEPTH
 BCC NL3
 LDA #0
 STA *VFLG
NL3 LDY *IPTR
 CPY *OLDTV
 BNE L1
 LDA *STUK
 AND #7
 CMP #5
 BNE NL1
 LDA *VFLG
 BNE L1
 LDA *DEPTH
 STA *VFLG
NL1 LDA #2
 JMP NL2
L1 LDA #0
NL2 STA *CLASS
 TYA
 AND #7
 STA *TOX
 EOR *IPTR
 STA *TOY
;
;
;
NZET LDX *JPTR
 LDA *TOX
 CLC
 ADC XDIR,X
 STA *TOX
 AND #$F8
 BNE BREAK
 LDA *TOY
 CLC
 ADC YDIR,X
 STA *TOY
 AND #$C7
 BNE BREAK
 LDA *TOX
 ORA *TOY
 STA *BPTR
 TAX
 LDA *BORD,X
 STA *TOSTUK
 LDX *PROCES
 CPX #L,DENK
 BEQ L4D
 CPX #L,ZTST
 BEQ L4D
 LDA *MODE
 AND #$10
 BNE L4D
 LDY #1
 LDA *STUK
 AND #7
 CMP #2
 BCS L4G
 LDX *BPTR
 LDA *BORD,X
 BEQ L4G
 PHA
 ORA #$40
 STA *BORD,X
 PLA
 AND #$40
 BNE L4H
 LDA *TOSTUK
 AND #7
 CMP #2
 BCS L4G
L4H LDY #3
L4G STY *TMP
 LDX *PROCES
 LDY *BPTR
 LDA (DEKCNT),Y
 CPX #L,KIJK
 BNE L4E
 CLC
 ADC *TMP
 JMP L4F
L4E SEC
 SBC *TMP
L4F STA (DEKCNT),Y
 LDA *TOSTUK
 AND #8
 CMP *KLEUR
 BNE L4D
 EOR *TOSTUK
 ASL A
 ASL A
 ASL A
 ASL A
 CMP #$60
 BEQ L4D
 CLC
 ADC *JPTR
 TAX
 LDA RANGE,X
 BEQ L4D
 BMI L4D
 DEC *KCNT
 BEQ LBR
 STA *MODE
 AND #$0F
 CMP *KCNT
 BCS JNZ
 STA *KCNT
JNZ JMP NZET
L4D LDY *CLASS
 LDA *TOSTUK
 BNE L5A
 LDA #$20
 BIT *MODE
 BEQ L4C
 JMP GEP
L5A AND #8
 CMP *KLEUR
 BNE L4A
LBR JMP BREAK
L4A INY
 LDA #$10
 BIT *MODE
 BNE LBR
L4C TYA
 LDY *BPTR
L5 CPY *SV
 BNE L2
 ORA #4
L2 CPY *OLDSV
 BNE L3
 ORA #8
L3 CPY *TV
 BNE L4B
 ORA #$10
L4B STA *CLASS
;
;
;
 JSR INDIR
 LDA *CLASS
 LSR A
 BCS L7
 DEC *KCNT
 BNE NZ
 INC *KCNT
 LDA *RPTR
 LDY *TOY
 CMP #3
 BNE L6
 CPY #$28
 BNE L7
NZ JMP NZET
L6 CMP #$11
 BNE L7A
 CPY #$10
 BEQ NZ
L7 JMP BREAK
L7A LDA *MODE
 AND #$40
 BEQ L7
 LDA *STUK
 BPL L7
 LDA *EXTRA
 CMP #H,MSCHK
 BEQ L7
 JSR HOEK
 LDA *BORD,X
 BPL L7
 TXA
 EOR #1
 TAX
 LDA *BORD,X
 BNE L7
 LDA *MODE
 AND #$BF
 ORA #$90
 STA *MODE
 JMP NZET
GEP INY
 LDA *TV
 AND #$7F
 TAX
 LDA *BORD,X
 EOR *STUK
 CMP #9
 BNE L7
 LDA *SV
 CLC
 ADC *TV
 LSR A
 TAX
 EOR *SV
 AND #7
 BNE L7
 CPX *BPTR
 BNE L7
 LDA *MODE
 ORA #$88
 STA *MODE
 JMP L4C
INDIR JMP (PROCES)
;
;
;
DENK LDA *TOSTUK
 AND #7
 CMP #6
 BEQ BAD
 LDA *OMODE
 AND #$88
 CMP #$80
 BNE GOOD
 LDA *SV
 CLC
 ADC *TV
 LSR A
 CMP *BPTR
 BNE GOOD
BAD LDX #L,SCHAAK
 LDY #H,SCHAAK
 STX *MAXVAL
 STY *MAXVAL+1
 JMP L12
GOOD LDA *OLDSV
 AND #$3F
 CMP *BPTR
 BNE PROC
 LDA *OLDTV
 AND #$3F
 CMP *IPTR
 BNE PROC
 TSX
 LDA SAVT,X
 AND #$3F
 CMP *SV
 BNE PROC
 LDA SAVS,X
 AND #$3F
 CMP *TV
 BNE PROC
 JSR EVAL
L9A STX *STAVAL
 STY *STAVAL+1
 JMP L8A
;
;
;
PROC LDA *DEPTH
 BNE L8B
 JSR STATUS ;PRINT STATUS INFO
L8B LDA #0
 STA *S2FLG
 STA *SFLG
 STA *DEKFLG
 LDX *DEPTH
 CPX *PANIK
 BCS L8C
 STA *PANIK
L8C LDA *EXTRA
 CMP #H,MSCHK
 BNE L903
 JMP L9H
L903 LDA *STUK
 JSR PTB
 BNE L901
 LDY *TOY
 CPY #8
 BEQ L902
 CPY #$30
 BNE L901
L902 LDX *PANIK
 BNE L901
 LDX *DEPTH
 INX
 STX *PANIK
 LDA *STUK
 ORA #$10
 LDY *IPTR
 STA BORD,Y
 JMP L9M
L901 TAX
 LDA SCOD,X
 LDX *BPTR
 AND *MARK,X
 BEQ L9I
 LDX *TV
 LDA *BORD,X
 AND #7
 CMP #6
 BNE WS2
 LDA *EINDSP
 BNE WS2
WS1 INC *S2FLG
WS2 LDX *PASFLG
 INX
 BMI L9I
 INC *SFLG
 LDA *STUK
 AND #7
 CMP #2
 BEQ WS3
 LDA *EINDSP
 BEQ WS3
 TSX
 LDA $114,X
 CMP #H,MSCHK
 BNE L9I
 LDA $116,X
 CMP *IPTR
 BNE WS3
 LDY *JPTR
 LDA XDIR,Y
 CLC
 ADC YDIR,Y
 CMP $117,X
 BNE L9I
WS3 LDY *BPTR
 LDX *PASFLG
 BPL WS4
 LDA (DEKCNT),Y
 CMP #$FF
 BNE WS4
 LDX *BPTR
 CPX *SV
 BEQ L9I
WS4 LDA (DEKCNT),Y
 BPL L9I
WSK LDA *CLASS
 ORA #1
 TAX
 JMP L9I1
L9I LDX *CLASS
L9I1 LDA *COST
 CLC
 ADC PRICE,X
 CMP *MAXCOS
 BCS L9P
 JMP L9
L9P LDA *EXTRA
 CMP #H,MSCHK
 BNE L9J1
 LDX *PASFLG
 INX
 BPL L9J
 JMP L8
L9J1 LDX *PASFLG
 BMI L9N8
 CMP #$F1
 BMI L9E
;
;
;
L9H LDA *ALARM
 BMI L9N8
 CMP *IPTR
 BEQ L9E
 LDA *AGRES
 AND #$3F
LLP CMP *BPTR
 BEQ L9E
 CLC
 ADC *LINE
 CMP *ALARM
 BNE LLP
 JMP L9C
L9E LDA *EXTRA
 CMP #H,MSCHK
 BEQ L9I
L9J DEC *PASFLG
 JSR STAT
 LDA *COST
 JSR DYNAM
 INC *PASFLG
 LDA *DEKFLG
 BPL L9D1
 INC *DEKFLG
 JMP L9N
L9D1 JMP L9D
L9C LDA *EXTRA
 CMP #H,MSCHK
 BNE L9N1
 JMP L8
L9N8 JMP L9N
L9N1 LDA *AGRES
 BPL L9N
 LDY *ALARM
 LDA *STUK
 AND #7
 TAX
 CMP #2
 BCC L9N2
 LDA (DEKCNT),Y
 CMP #1
 BNE L9N
L9N2 TYA
 AND #7
 SEC
 SBC *TOX
 STA *TMP
 BEQ TD
 TYA
 SEC
 SBC *TOY
 LSR A
 LSR A
 LSR A
 BEQ TD
 STA *XSAV
 AND #$10
 BEQ L9N7
 LDA #$E0
L9N7 ORA *XSAV
 TAY
 CMP *TMP
 BEQ DL
 CLC
 ADC *TMP
 BEQ DL
 CPX #2
 BNE L9N
 LDX #10
L9N4 STX *TMP
 LDA *LAST
 PHA
 LDA *BPTR
 STA *LAST
 LDA *ALARM
 JSR DIF
 TAX
 PLA
 STA *LAST
 CPX *TMP
 BCS L9N
 JMP L9J
L9N6 TXA
 ASL A
 SEC
 SBC #1
 STY *TMP
 CMP *TMP
 BNE L9N
 JMP L9J
TD LDA #4
 BNE L9N3
DL CPX #2
 BCC L9N6
 LDA #2
L9N3 AND SCOD,X
 BEQ L9N5
 INC *DEKFLG
 JMP L9J
L9N5 CPX #6
 BEQ L9N4
;
;
;
L9N LDA *KFLG
 BEQ L9F
 LDA *OLDTV
 CMP *IPTR
 BNE KR1
 LDA *STUK
 JSR PTB
 BEQ L9M1
KR1 LDX *TV
 JSR PT2
 BNE L9F
 LDA *STUK
 AND #7
 CMP #6
 BEQ DTST
 CMP #3
 BCS L9F
 BNE L9R
DTST LDA *LAST
 PHA
 LDA *TV
 ASL A
 SEC
 SBC *SV
 STA *LAST
 LDA *BPTR
 JSR DIF
 STA *TMP
 LDA *TV
 STA *LAST
 LDA *IPTR
 JSR DIF
 TAX
 PLA
 STA *LAST
 CPX *TMP
 BCS L9M2
L9R LDY #$F8
 JMP L9Q
;
;
;
L9F LDA *STUK
 JSR PTB
 BNE L90
 LDA *TOY
L9M1 BEQ L9M
 CMP #$38
 BEQ L9M
 LDA *TOX
 BEQ L90
 CMP #7
 BEQ L90
 LDA *KLEUR
 EOR #8
 ASL A
 SEC
 SBC #8
 CLC
 ADC *BPTR
 TAX
 DEX
 JSR BUIT
 BCC L90
 INX
 INX
 JSR BUIT
L9M2 BCS L9M
L90 LDX *DEPTH
 CPX *PANIK
 BEQ L9M
 LDA *MODE
 BPL L9Q1
 LDY *EXTRA
 LDX #15
 JMP L9A
L9Q1 LDY *EXTRA
L9Q LDX *S2FLG
 BEQ L9Q2
 LDX *DFLG
 BEQ L9Q3
 INY
L9Q3 LDX #$C0
L9Q2 LDA *PASFLG
 BMI L9Q6
 STY *TMP
 STX *XSAV
 LDY *BPTR
 LDA *TOSTUK
 JSR WAARDE
 BEQ L9Q5
 CLC
 ADC *TMP
 STA *TMP
L9Q4 LDA (DEKCNT),Y
 BMI L9Q5
 LDA *STUK
 JSR WAARDE
 EOR #$FF
 SEC
 ADC *TMP
 STA *TMP
L9Q5 LDY *TMP
 LDX *XSAV
L9Q6 JMP L9A
L9M LDA *COST
L9 PHA
 JSR STAT
 PLA
 JSR DYNAM
 LDX *IPTR
 LDA *STUK
 STA *BORD,X
L9D LDX *DYNVAL
 LDY *DYNVAL+1
 CPX #L,SCHAAK
 BNE X2
 CPY #H,SCHAAK
 BEQ L8
;
;
;
X2 SEC
 LDA *STAVAL
 SBC *DYNVAL
 STA *STAVAL
 LDA *STAVAL+1
 SBC *DYNVAL+1
 STA *STAVAL+1
L8A INC *ZETTEN
 LDA *STAVAL
 LDY *STAVAL+1
 CPY *MAXVAL+1
 BMI L8
 BNE L10
 CMP *MAXVAL
 BCC L8
 BEQ L8
L10 STA *MAXVAL
 STY *MAXVAL+1
 CPY *LIMIT+1
 BMI L11
 BNE L12
 CMP *LIMIT
 BCS L12
L11 LDA *EXTRA
 CMP #H,MSCHK
 BEQ L11A
 CMP #$F1
 BPL L11B
 CLC
 ADC #16
 CMP *STAVAL+1
 BPL L11A
 STA *EXTRA
L11B TYA
 BMI L11A
 LDA #$FF
L11C STA *ALARM
L11A LDA *DEPTH
 BNE L8
 LDA *BPTR
 STA *ZET+1
 LDA *IPTR
 STA *ZET
 LDA *MODE
 STA *ZET+2
L8 RTS
L12 PLA
 PLA
 LDA *IPTR
 STA *DREIG
 JMP CUTOFF
;
;
;
OVFLW LDX #0
 STX *DYNVAL
 STX *DYNVAL+1
 RTS
DYNAM LDY *DEPTH
 INY
 CPY *MAXDEP
 BCS OVFLW
 STA *TMP
 CPY #2
 BCC ZL1
 TSX
 LDA $110,X
 SEC
 SBC $112,X
 STA *XCNT
 LDA $10F,X
 SBC $111,X
 STA *YCNT
 BPL NB1
 LDX *XCNT
 LSR A
 ROR *XCNT
 LSR A
 ROR *XCNT
 ORA #$C0
 PHA
 TXA
 CLC
 ADC *XCNT
 STA *XCNT
 PLA
 ADC *YCNT
 STA *YCNT
NB1 CMP *MAXVAL+1
 BMI ZL1
 BNE ZL2
 LDA *XCNT
 CMP *MAXVAL
 BCS ZL2
ZL1 LDA *MAXVAL
 STA *XCNT
 LDA *MAXVAL+1
 STA *YCNT
ZL2 LDA *STAVAL
 SEC
 SBC *XCNT
 STA *XCNT
 LDA *STAVAL+1
 SBC *YCNT
 STA *YCNT
 LDX *TMP
 LDA *PASFLG
 BPL NCT
 LDA *KFLG
 ORA *SFLG
 BNE NCT
 TXA
 CLC
 ADC #4
 CMP *MAXCOS
 BCC NCT
 LDA *YCNT
 BPL NCT
 JMP OVFLW
NCT STY *DEPTH
 LDA *COST
 PHA
 STX *COST
 JSR DOEZET
 LDA *DEKCNT
 CLC
 ADC #64
 STA *DEKCNT
 BCC NDK
 INC *DEKCNT+1
NDK LDX *BPTR
 LDY *IPTR
 JSR UPDAT
 LDA *MVELD
 PHA
 LDA *LINE
 PHA
 LDA *AGRES
 PHA
 LDA *ALARM
 PHA
 LDA *EXTRA
 PHA
 LDA *OMODE
 PHA
 LDA *MODE
 STA *OMODE
 LDA *RPTR
 PHA
 LDA *CLASS
 PHA
 LDA *LIMIT
 PHA
 LDA *LIMIT+1
 PHA
 LDA *STAVAL
 PHA
 LDA *XCNT
 STA *LIMIT
 LDA *STAVAL+1
 PHA
 LDA *YCNT
 STA *LIMIT+1
 LDA *MAXVAL
 PHA
 LDA *MAXVAL+1
 PHA
 LDA *ZETTEN
 PHA
 LDA *KCNT
 PHA
 LDA *STUK
 PHA
 LDA *TOSTUK
 PHA
 LDA *OLDSV
 PHA
 LDA *SV
 STA *OLDSV
 LDA *IPTR
 STA *SV
 LDA *OLDTV
 PHA
 LDA *TV
 STA *OLDTV
 LDA *BPTR
 STA *TV
 JSR SCAN0
 LDA *TV
 STA *BPTR
 AND #7
 STA *TOX
 EOR *BPTR
 STA *TOY
 LDA *OLDTV
 STA *TV
 PLA
 STA *OLDTV
 LDA *SV
 STA *IPTR
 LDA *OLDSV
 STA *SV
 PLA
 STA *OLDSV
 PLA
 STA *TOSTUK
 PLA
 STA *STUK
 PLA
 STA *KCNT
 PLA
 STA *ZETTEN
 PLA
 STA *MAXVAL+1
 PLA
 STA *MAXVAL
 PLA
 STA *STAVAL+1
 PLA
 STA *STAVAL
 PLA
 STA *LIMIT+1
 PLA
 STA *LIMIT
 PLA
 STA *CLASS
 PLA
 STA *RPTR
 AND #$0F
 STA *JPTR
 LDA *OMODE
 STA *MODE
 PLA
 STA *OMODE
 PLA
 STA *EXTRA
 PLA
 STA *ALARM
 PLA
 STA *AGRES
 PLA
 STA *LINE
 PLA
 STA *MVELD
 LDA *DEKCNT
 SEC
 SBC #64
 STA *DEKCNT
 BCS WDK
 DEC *DEKCNT+1
WDK JSR ONTDOE
 LDX *IPTR
 LDY *BPTR
 JSR UPDAT
 PLA
 STA *COST
 DEC *DEPTH
 RTS
;
;
;
DOEZET LDA *MODE
 BPL DZ3
 AND #8
 BEQ ROK
EP LDA *TV
 AND #$7F
 TAX
 LDA #0
 STA *BORD,X
 JMP DZ3
ROK JSR HOEK
 LDA *BORD,X
 STA BORD,Y
 LDA #0
 STA *BORD,X
DZ3 LDX *IPTR
 LDY *BPTR
 JSR PT2
 BNE DZ1
 LDA *BORD,X
 AND #$1F
 CPY #8
 BCC DZ2
 CPY #$38
 BCC DZ1
DZ2 ORA #5
 AND #$EF
DZ1 STA BORD,Y
 JSR KPT
 LDA #0
 STA *BORD,X
WISSEL LDA *KLEUR
 EOR #8
 STA *KLEUR
 LDA #0
 SEC
 SBC *BONUS
 STA *BONUS
 RTS
;
;
;
ONTDOE LDA *MODE
 BPL OD1
 AND #8
 BEQ ONTROK
ONTEP LDA *TV
 AND #$7F
 TAX
 LDA *STUK
 EOR #9
 STA *BORD,X
 JMP OD1
ONTROK JSR HOEK
 LDA BORD,Y
 STA *BORD,X
 LDA #0
 STA BORD,Y
OD1 LDX *BPTR
 LDY *IPTR
 LDA *TOSTUK
 STA *BORD,X
 LDA *STUK
 STA BORD,Y
 JSR KPT
 JMP WISSEL
HOEK LDA *IPTR
 CLC
 ADC *BPTR
 LSR A
 TAY
 SEC
 SBC *BPTR
 LSR A
 AND #7
 EOR *BPTR
 AND #7
 EOR *BPTR
 TAX
 RTS
;
;
;
EVAL LDX #0
 STX *SUM
 STX *SUM+1
E1 LDA *BORD,X
 STX *XSAV
 JSR WAARDE
 LDX *XSAV
 LDA *BORD,X
 AND #8
 CMP *KLEUR
 BNE E2
 SEC
 LDA *SUM
 SBC *STAVAL
 STA *SUM
 LDA *SUM+1
 SBC *STAVAL+1
 JMP E3
E2 CLC
 LDA *SUM
 ADC *STAVAL
 STA *SUM
 LDA *SUM+1
 ADC *STAVAL+1
E3 STA *SUM+1
 INX
 CPX #64
 BNE E1
 LDX *SUM
 LDY *SUM+1
 RTS
;
;
;
PTST CLC
 ADC *YCNT
PT0 TAX
PTA LDA *BORD,X
 AND #8
 CMP *KLEUR
 BNE PT1
PT2 LDA *BORD,X
PTB AND #$0F
 CMP #8
 BEQ PT1
 CMP #1
PT1 RTS
;
;
;
STAT LDA *MODE
 BPL GST
 AND #8
 BEQ WROK
WEP LDA #1
 JMP GST2
WROK LDY #$FF
 LDA *BPTR
 EOR #$10
 JSR PT0
 BNE WR0
 INY
 INY
WR0 TXA
 EOR #$18
 JSR PT0
 BNE WR1
 INY
 INY
 INY
WR1 INX
 JSR PTA
 BNE WR2
 INY
WR2 DEX
 DEX
 JSR PTA
 BNE WR3
 INY
 INY
WR3 TYA
 STY *TMP
 ASL A
 ASL A
 CLC
 ADC *TMP
 ASL A
 STA *TMP
 LDA #0
 STA *STAVAL+1
 JMP ST3
GST LDA *TOSTUK
GST2 JSR WAARDE
 LDA *STUK
 AND #7
 TAX
 LDA #0
 CPX #6
 BNE ST0
 LDX *EINDSP
 BEQ ST1A
 LDA *BPTR
 JSR DIF
 STA *TMP
 LDA *IPTR
 JSR DIF
 SEC
 SBC *TMP
 ASL A
 ASL A
 JMP ST1
ST1A SEC
 SBC #20
AST1 JMP ST1
ST0 CPX #4
 BCC ST2A
 BNE ST2E
 LDX *TOSTUK
 BNE ST2F
 STA *TMP
 LDA *IPTR
 EOR *BPTR
 AND #$20
 BEQ ST2C
 LDA *KLEUR
 ASL A
 ASL A
 EOR *BPTR
 AND #$20
 BEQ ST2D
 LDA #25
 BNE ST2C
ST2D LDA #$100-25
ST2C CLC
 ADC *TMP
 TAY
 LDA *IPTR
 AND #7
 TAX
 TYA
 SEC
 SBC TOREN,X
 TAY
 LDA *BPTR
 AND #7
 TAX
 TYA
 CLC
 ADC TOREN,X
 JMP ST2F
ST2E CPX #5
 BNE ST2F
 LDX *NR
 CPX #8
 BCS ST2F
 SEC
 SBC #15
ST2F JMP ST2
ST2A CPX #2
 BCS AST1
 LDX *PANIK
 DEX
 CPX *DEPTH
 BNE NPB
 INC *STAVAL+1
NPB CLC
 ADC #15
 LDX *EINDSP
 BEQ ESP
 CLC
 ADC #30
ESP LDX *KLEUR
 BEQ ZAZ
WAZ LDX *KP1
 LDY *BORD,X
 BMI NKV
 LDX *IPTR
 STA *TMP
 LDA *MARK,X
 AND #$0E
 BEQ NKV2
 BNE NKV3
ZAZ LDX *KP2
 LDY *BORD,X
 BMI NKV
 LDX *IPTR
 STA *TMP
 LDA *MARK,X
 AND #$E0
 BEQ NKV2
NKV3 LDA *TMP
 SEC
 SBC #30
NKV STA *TMP
NKV2 LDA *IPTR
 AND #$38
 STA *YCNT
 EOR *IPTR
 STA *XCNT
 LDA *XCNT
 SEC
 SBC #2
 BMI SP1
 JSR PTST
 BEQ SP2
SP1 LDA *TMP
 SEC
 SBC #15
 STA *TMP
SP2 LDA *XCNT
 CLC
 ADC #2
 CMP #8
 BCS SP3
 JSR PTST
 BEQ SP4
SP3 LDA *TMP
 SEC
 SBC #15
 STA *TMP
SP4 LDA *BPTR
 SEC
 SBC #8
 BMI PROM
 CMP *IPTR
 BEQ SP5
 JSR PT0
 BNE SP5
 SEC
 LDA *TMP
 SBC #40
 STA *TMP
SP5 LDA *BPTR
 CLC
 ADC #8
 CMP #64
 BCS PROM
 CMP *IPTR
 BEQ SP6
 JSR PT0
 BNE SP6
 SEC
 LDA *TMP
 SBC #40
 STA *TMP
SP6 LDA *TMP
 JMP ST1
PROM LDA #7
 CLC
 ADC *STAVAL+1
 STA *STAVAL+1
 LDA #0
ST1 LDX *BPTR
 CLC
 ADC POSVAL,X
 LDX *IPTR
 SEC
 SBC POSVAL,X
ST2 STA *TMP
 LDA *OLDTV
 AND #$3F
 CMP *IPTR
 BNE ST2B
 LDA *STUK
 AND #7
 CMP #6
 BEQ ST2B
 CMP #3
 BCC ST2B
 LDA *TMP
 SEC
 SBC #15
 STA *TMP
ST2B LDA *KLEUR
 ASL A
 CLC
 ADC *BPTR
 SEC
 SBC #8
 TAY
 AND #$C0
 BNE ST3
 TYA
 CMP *IPTR
 BEQ ST3
 JSR PT0
 BNE ST3
 LDA *TMP
 SEC
 SBC #15
 STA *TMP
ST3 LDA *TMP
 BPL ST4
 DEC *STAVAL+1
ST4 LDX *TOSTUK
 CPX #2
 BCC ST5
 CPX #8
 BEQ ST5
 BIT *BONUS
 BPL ST4A
 INC *STAVAL+1
ST4A SBC *BONUS
 BCS ST5
 DEC *STAVAL+1
ST5 STA *STAVAL
 LDA *DEPTH
 BNE S1
 LDA *RANDOM
 CLC
 ADC #$27
 STA *RANDOM
 LSR A
 LSR A
 LSR A
 LSR A
 CLC
 ADC *STAVAL
 STA *STAVAL
 BCC S1
 INC *STAVAL+1
S1 RTS
;
;
;
WAARDE AND #$1F
 CMP #$0F
 PHP
 AND #$0F
 CMP #8
 BNE W1
 LDA #1
W1 AND #7
 ASL A
 TAX
 LDA WTAB,X
 STA *STAVAL
 LDA WTAB+1,X
 PLP
 BCC W2
 LDA #2
W2 STA *STAVAL+1
 RTS
;
;
;
MTMOB LDA #L,TZET
 STA *PROCES
 LDA #H,TZET
 STA *PROCES+1
 JSR SCAN3
 LDA *ZETTEN
 CLC
 ADC *MOB2
 ROR A
 STA *MOB2
 RTS
TZET INC *ZETTEN
 RTS
;
;
;
ZTST LDA *IPTR
 CMP *ZET
 BNE UNEQ
 LDA *BPTR
 CMP *ZET+1
 BNE UNEQ
 LDA *MODE
 STA *ZET+2
 INC *OKFLG
UNEQ INC *ZETTEN
 RTS
;
;
;
KTEL LDY #63
 LDA #1
 STA *KFLG
 LDA #0
 STA *DFLG
 STA *PFLG
 STA *SDIF
 LDX #7
KT0 STA TOREN,X
 DEX
 BPL KT0
KT1 LDA BORD,Y
 BEQ KT2
 AND #7
 CMP #6
 BNE KT4
 LDA BORD,Y
 JSR KPT
 JMP KT2
KT4 CMP #2
 BEQ KT5
 BCS KT3
 INC *PFLG
 TYA
 AND #7
 TAX
 LDA TOREN,X
 SEC
 SBC #12
 STA TOREN,X
 JMP KT2
KT3 LDX #0
 STX *KFLG
 CMP #5
 BNE KT5
 LDX #1
 STX *DFLG
KT5 LDA BORD,Y
 AND #8
 CMP *KLEUR
 BNE KT6
 DEC *SDIF
 JMP KT2
KT6 INC *SDIF
KT2 DEY
 BPL KT1
 RTS
;
;
;
DIF JSR SPLIT
 STX *XCNT
 STY *YCNT
 LDA *LAST
 JSR SPLIT
 TXA
 SEC
 SBC *XCNT
 JSR ABS
 STA *XSAV
 TYA
 SEC
 SBC *YCNT
 JSR ABS
 CMP *XSAV
 BPL D1
 TAX
 LDA *XSAV
 STX *XSAV
D1 ASL A
 ASL A
 CLC
 ADC *XSAV
 RTS
;
;
;
SPLIT PHA
 AND #7
 TAX
 PLA
 LSR A
 LSR A
 LSR A
 TAY
 RTS
;
;
;
ABS CMP #0
 BPL AB1
 EOR #$FF
 CLC
 ADC #0
AB1 RTS
;
;
;
P1 JSR OUTALL ;PRINT CHAR
 INX
PRT LDA MES1,X
 BNE P1
 RTS
COMP INC *ZETTEN
 RTS
;
;
;
KIJK LDA *TOSTUK
 BEQ K1
 AND #7
 CMP #6
 BEQ K2
 LDX *JPTR
 LDA GRP,X
 CMP *MOVDIR
 BEQ K1
 TSX
 LDA $116,X
 CMP #H,MSCHK
 BEQ K2
 LDA $113,X
 LSR A
 BEQ K1A
 BCS K2
K1A LDA *CLASS
 AND #4
 BNE K2
 LDX *IPTR
 CPX *TV
 BNE K1
K2 LDA *STUK
 AND #$0F
 TAX
 LDA SCOD,X
 LDY *BPTR
 AND MARK,Y
 BEQ K5
 LDA (DEKCNT),Y
 BMI K5
 BEQ K5
K5 LDA *TOSTUK
 BEQ K1
 JSR WAARDE
 STA *TMP
 LDA *STUK
 JSR WAARDE
 CMP *TMP
 LDA #0
 BCC K4
 LDY *BPTR
 LDA (DEKCNT),Y
 BEQ K1
 BMI K1
 LDA #$80
K4 LDX *TMP
 CPX *EXTRA
 BMI K1
 BEQ K1
K3 STX *EXTRA
 ORA *IPTR
 STA *AGRES
 LDX *JPTR
 LDA XDIR,X
 CLC
 ADC YDIR,X
 STA *LINE
 LDX *BPTR
 STX *ALARM
K1 RTS
;
;
;
UPDAT LDA *MARK,X
 AND #$EE
 BEQ UD1
 JMP WIS
UD1 LDA MARK,Y
 AND #$EE
 BEQ UD2
 JMP MERK
UD2 RTS
WIS LDX #63
 LDA #0
WI1 STA *MARK,X
 DEX
 BPL WI1
MERK LDY *KP1
 LDA #1
 JSR PAARD
 LDY *KP2
 LDA #$10
 JSR PAARD
 LDX #7
MK1 LDY *KP1
 LDA #2
 JSR LIJN
 LDY *KP2
 LDA #$20
 JSR LIJN
 DEX
 CPX #4
 BCS MK1
MK2 LDY *KP1
 LDA #4
 JSR LIJN
 LDY *KP2
 LDA #$40
 JSR LIJN
 DEX
 BPL MK2
 RTS
;
;
;
PAARD STY *TMP
 STA *CODE
 LDY #7
PD0 LDA *TMP
 CLC
 ADC RICHT+8,Y
 BMI PD2
 TAX
 CMP #64
 BCS PD2
 EOR *TMP
 AND #4
 BEQ PD1
 LDA *TMP
 EOR RICHT+8,Y
 AND #4
 BNE PD2
PD1 LDA *MARK,X
 ORA *CODE
 STA *MARK,X
PD2 DEY
 BPL PD0
 RTS
;
;
;
LIJN STA *CODE
LY0 TYA
 STY *TMP
 CLC
 ADC RICHT,X
 BMI LY2
 TAY
 CMP #64
 BCS LY2
 EOR *TMP
 AND #4
 BEQ LY1
 LDA *TMP
 EOR RICHT,X
 AND #4
 BNE LY2
LY1 LDA MARK,Y
 ORA *CODE
 STA MARK,Y
 LDA BORD,Y
 BEQ LY0
LY2 RTS
;
;
;
BUIT LDA *BORD,X
 AND #8
 CMP *KLEUR
 BEQ BT1
 LDA *BORD,X
 AND #7
 CMP #2
 RTS
BT1 CLC
 RTS
;
;
;
KPT AND #$0F
 CMP #6
 BNE KPT1
 STY *KP2
 JMP KPT2
KPT1 CMP #$0E
 BNE KPT2
 STY *KP1
KPT2 RTS
;
;
;
WTYD LDX #3
 LDA *MTYD
 CLC
 ADC #L,TPZ
 STA *MTYD
 BCC WT1
 INC *MTYD+1
WT1 SEI
WTL LDA *ETYD,X
 PHA
 LDA *ETYD+4,X
 STA *ETYD,X
 PLA
 STA *ETYD+4,X
 DEX
 BPL WTL
 CLI
 RTS
;
;
;
STATUS JSR CRLF ;NIEUWE REGEL
 LDA *ZETTEN 
 JSR NUMA ;PRINT 2 HEX
 JSR BLANK ;SPATIE
 LDA *IPTR
 LDX *BPTR
 JSR WRAX ;4 HEX
 JSR BLANK
 LDA *MAXVAL+1
 LDX *MAXVAL
 JSR WRAX
 JSR BLANK
 LDA *MAXCOS
 JSR NUMA
 JSR BLANK
 LDA $16FF
 JSR NUMA
 RTS
;
;
;
INIT LDX #0
 CLD
 STX *PASFLG
 STX *DEPTH
 STX *COST
 STX *OMODE
 STX *KFLG
 STX *MVELD
 STX *DREIG
 STX *DEKCNT
 DEX
 STX *IPTR
 STX *OLDSV
 STX *BPTR
 STX *OLDTV
 LDX #1
 STX *NR
 LDX #9
 STX *MAXDEP
 LDX #9
 STX *MAXCOS
 LDX #8
 STX *KLEUR
 LDX #L,SCHAAK
 STX *LIMIT
 LDX #H,SCHAAK
 STX *LIMIT+1
 LDX #64
 STX *MOB
 STX *MOB2
 LDX #$14
 STX *DEKCNT+1
 LDX #7
ILP LDA BEG,X
 ORA #$80
 STA *BORD,X
 ORA #8
 STA *BORD+$38,X
 LDA #$81
 STA *BORD+8,X
 LDA #$88
 STA *BORD+$30,X
 LDA #0
 STA *BORD+$10,X
 STA *BORD+$18,X
 STA *BORD+$20,X
 STA *BORD+$28,X
 STA *ETYD,X
 DEX
 BPL ILP
 LDX #7
 STX *MTYD+1
 STX *MTYD+5
 CLI
 RTS
ETEXT .DS 309
;
;
;
POSVAL .BY 0 3 10 15 15 10 3 0
 .BY 5 20 25 28 28  30 20 5
 .BY 10 30 42 45 45 42 30 10
 .BY 15 35 45 50 50 45 35 15
 .BY 15 35 45 50 50 45 35 15
 .BY 10 30 42 45 45 42 30 10
 .BY 5 20 25 28 28 30 20 5
 .BY 0 3 10 15 15 10 3 0
;
;
;
RANGE .BY 0 0 $FF $11 0 $FB $21 $21 0 0 0 0 0 0 0 $F7
 .BY 0 $11 0 $ED $21 $21 0 0 0 0 0 0 0 0 0 $E9
 .BY 0 0 0 0 0 0 0 $DF 1 1 1 1 1 1 1 1
 .BY 0 0 0 $CF 7 7 7 7 0 0 0 0 0 0 0 $C7
 .BY 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 $BB
 .BY 7 7 7 7 7 7 7 7 0 0 0 0 0 0 0 $A7
 .BY $41 1 $41 1 1 1 1 1 0 0 0 0 0 0 0 $97
XDIR .BY 1 0 $FF 0 1 $FF $FF 1 2 1 $FF $FE $FE $FF 1 2
YDIR .BY 0 8 0 $F8 8 8 $F8 $F8 8 16 16 8 $F8 $F0 $F0 $F8
GRP .BY 0 1 0 1 2 3 2 3 4 4 4 4 4 4 4 4
PRICE .BY 4 3 4 0 4 0 4 0 4 0 4 0 4 0 4 0 
 .BY 8 0 8 0 8 0 8 0 8 0 8 0 8 0 8 0
WTAB .SE 0
 .SE $100
 .SE $300
 .SE $300
 .SE $500
 .SE $900
 .SE SCHAAK
 .SE 0
BEG .BY 4 2 3 5 6 3 2 4
RICHT .BY 1 8 $FF $F8 9 7 $F7 $F9
 .BY 10 17 15 6 $F6 $EF $F1 $FA
SCOD .BY 0 0 1 2 4 6 0 0
 .BY 0 0 $10 $20 $40 $60 0 0
EDATA .DS 2
;
;
;
 .SI EZERO
 .SI ETEXT
 .SI EDATA
;
;
;
NOTA .DI =+576 ;9*64
TOREN .DI NOTA+64
;
;
;
 .EN
